//
//						WindowImpl.h
//

#ifndef __NEWA_WINDOW_IMPL_H
#define __NEWA_WINDOW_IMPL_H

#include "Base.h"
#include "GraphicsBase.h"
#include <windows.h>

#ifndef LOKI_INHERITED_PIMPL_NAME
#define LOKI_INHERITED_PIMPL_NAME m_impl
#endif
#include <loki/Pimpl.h>

namespace newa
{
	class NativeWindow;
}

namespace Loki
{
	template <>
	class ImplOf< newa::NativeWindow >
	{
	public:
		void owner( newa::NativeWindow * win );

		newa::NativeWindow * owner() const;

		void create( int CreationFlags, newa::NativeWindow * parent );

		void destroy();

		newa::Rect rect() const;

		void rect( const newa::Rect& r );

		newa::Rect clientRect() const;

		void clientRect( const newa::Rect& );

		void invalidate();

		void flushPixBuf( const newa::PixBuf& pb );

		void invalidate( const newa::Rect& r );

		void captureMouse();

		void releaseMouse();

		void setFocus();

		HWND hwnd() const;

		void hdc( HDC _hdc );

		HDC hdc() const;

	private:
		static bool m_window_class_registered;
		HWND m_hwnd;
		HDC m_hdc;
		newa::NativeWindow * m_owner;
		newa::Rect m_rect;
	};
}

#endif
